﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListEmployeeChanges.aspx.cs" Inherits="ZX.WebApp.ListEmployeeChanges" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <!--CSS file (default YUI Sam Skin) -->
    <script src="../Scripts/EasyUI/js/jquery-1.6.min.js" type="text/javascript"></script>
    <link href="../Scripts/EasyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/EasyUI/js/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../Scripts/fullscreen.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <link href="../Styles/show/css/show-bar.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/base.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function addTabs(title, pageurl, icon) {
            if (!$('#tabs').tabs('exists', title)) {
                $('#tabs').tabs('add', {
                    title: title,
                    content: createFrame(pageurl),
                    iconCls: icon,
                    //closable: true,
                    width: $('#mainPanle').width() - 10,
                    height: $('#mainPanle').height() - 26
                });
            } else {
                $('#tabs').tabs('select', title);
            }
        }

        function createFrame(url) {
            var s = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
            return s;
        }

        var win = {
            a: 0,
            b: 0,
            c: 0,
            //d: 0
        }

        var employeeType="undefined";

        function show() {
            var btn = parent.document.getElementById("yui-gen0-button");
            $(btn).show();
        }

        function hide() {

            var btn = parent.document.getElementById("yui-gen0-button");
            $(btn).hide();
            var t = $.browser;
            /**/
            var ctrl = event.srcElement;
            //if ($.browser.msie) {
            switch (ctrl.innerHTML) {
                case "岗位异动":
                    if (win.a == 0) {
                        window.frames[0].location.reload();
                    }
                    win.a = 1;
                    break;
                case "薪酬异动":
                    if (win.b == 0) {
                        window.frames[1].location.reload();
                    }
                    win.b = 1;
                    break;
                case "离职":
                    if (win.c == 0) {
                        window.frames[2].location.reload();
                    }
                    win.c = 1;
                    break;
//                case "转正":
//                    if (win.d == 0) {
//                        window.frames[3].location.reload();
//                    }
//                    win.d = 1; break;
            }
            //}
            /**/
        }


        $(document).ready(function () {
            var id = '<%=GetStringFromQueryString("id","") %>';
            var condition = encodeURI("EmployeeID='" + id + "'");
            var functionID = '17d7f5ca-0df4-4427-898a-593cf927baa2'; //getPar(parent.location.href, "functionid");

            //addTabs("<span onclick='show();'>岗位异动</span>", "../Extend/AutoLoadForm.aspx?r=" + Math.random() +"&entity=hrEmployeeSalary&id=" + id);
            //addTabs("<span onclick='hide();'>薪酬异动</span>", "../Extend/AutoLoadForm.aspx?r=" + Math.random() +"&entity=hrEmployeeSalary");
            //addTabs("<span onclick='hide();'>离职异动</span>", "../Extend/AutoLoadForm.aspx?r=" + Math.random() +"&entity=hrEmployeeSalary");
            addTabs("<span onclick='hide();'>岗位异动</span>", "../Extend/YUIDataTableList.aspx?f=a&isShonwBtn=N&functionid=" + functionID + "&entity=V_hrEmployeePositions&condition=" + condition);
            addTabs("<span onclick='hide();'>薪酬异动</span>", "../Extend/YUIDataTableList.aspx?f=a&isShonwBtn=N&functionid=" + functionID + "&entity=V_hrEmployeeSalary&condition=" + condition);
            addTabs("<span onclick='hide();'>离职</span>", "../Extend/YUIDataTableList.aspx?f=b&isShonwBtn=N&functionid=" + functionID + "&entity=V_hrEmployeeChanges&condition=" + condition + " and ChangeType='离职'");

//            if (employeeType != "1") {
//                var formid = "6644274D-23D0-4C31-8256-531559F51A0A";
//                addTabs("<span onclick='hide();'>转正</span>", "../Extend/YUIDataTableList.aspx?f=a&isShonwBtn=N&functionid=" + functionID + "&entity=V_hrEmployeePositive&condition=" + condition + " and ChangeType='转正'");
//            }
            $('#tabs').tabs('select', "<span onclick='hide();'>岗位异动</span>");
            var btn = parent.document.getElementById("yui-gen0-button");
            $(btn).hide();
        });
    </script>
    <!--begin custom header content for this example-->
    <style type="text/css">
    .yui-skin-sam table {
	  width: 100%; 
    }
    
    #button-example-form fieldset, 
    #button-example-form fieldset div {
        border: 2px groove #ccc;
        margin: .5em;
        padding: .5em;
    }
</style>
   

</head>
<body class="easyui-layout">
      <div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
        </div>
    </div>
</body>
<script type="text/javascript">
    function Save() {
        //alert("");
        $("iframe")[0].contentWindow.Save();
    }
</script>
</html>

